class UaliasesController < ApplicationController
before_filter :authorize
 layout "page"
 active_scaffold :ualia do |config|
 	 	config.columns = :iscurrent,:name,:email_addr,:user,:profile
 	  config.label = "User Aliases"
 	  config.columns[:iscurrent].inplace_edit = true
 	   	  	  config.columns[:user].form_ui = :select  
 	 config.create.columns.exclude(:iscurrent,:user)
 	  	 config.update.columns.exclude(:iscurrent,:user)
 	  	 config.show.columns.exclude(:iscurrent,:user)
 	  	 config.columns[:name].label ="Alias Name"
 	  	 config.columns[:email_addr].label ="Email" 	  	 
 	  	 config.columns[:iscurrent].label ="Set Current Alias" 	  
 	  	 
		config.action_links.add 'mytest1', :label => 'Photo', :type => :record, :page => true 	  	 
 	  	 
 	  	     config.columns[:profile].form_ui = :textarea
    config.columns[:profile].options = {:rows => 60, :cols => 100}	 
 end
 
 def mytest
  Ualia.find(:all).each do |myobj|
   	myobj.iscurrent = false
   	myobj.save

   end

   currobj = Ualia.find(params[:id])
   currobj.iscurrent = true
   currobj.save
   
   $curruser=currobj.name
 end
 
 def mytest1
   redirect_to :controller=>'ualia_photos',:action=>'index',:ualia_id=> params[:id] 
 end
 

end
